<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
        >
<head>
    <title>Active Users</title>

    <link rel="stylesheet" type="text/css" href="../css/style.css" />

    <p:resources />
</head>
<body>
<f:view>
<h:form>
    <table width="100%">
        <tr>
            <td align="right"><a href="javascript:window.close();">Close</a></td>
        </tr>
    </table>
    <p:tabView>
        <p:tab title="Active Users Report">
    <p:dataTable id="tbl" var="user" value="#{activeUsers.listActiveUsers}" paginator="true" rows="20">

        <p:column>
                        <f:facet name="header">
                            <h:outputText value="Group"/>
                        </f:facet>
                        <h:outputText value="#{user.group.name}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="FirstName"/>
                        </f:facet>
                        <h:outputText value="#{user.firstName}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="LastName"/>
                        </f:facet>
                        <h:outputText value="#{user.lastName}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Login"/>
                        </f:facet>
                        <h:outputText value="#{user.login}"/>
                    </p:column>


    </p:dataTable>
 <h:panelGrid columns="1">
     <p:panel header="Export Data">
         <h:commandLink>
             <p:graphicImage value="icons/excel.png" />
             <p:dataExporter type="xls" target="tbl" fileName="activeUsers" />
         </h:commandLink>

         <h:commandLink>
             <p:graphicImage value="icons/pdf.png" />
             <p:dataExporter type="pdf" target="tbl" fileName="activeUsers"/>
         </h:commandLink>

       <h:commandLink>
                <p:graphicImage value="icons/csv.png" />
                <p:dataExporter type="csv" target="tbl" fileName="activeUsers" />
            </h:commandLink>

            <h:commandLink>
                <p:graphicImage value="icons/xml.png" />
                <p:dataExporter type="xml" target="tbl" fileName="activeUsers" />
           </h:commandLink>
     </p:panel>
 </h:panelGrid>
        
      </p:tab>
    </p:tabView>

</h:form>
</f:view>
</body>
</html>